<table>
        <tr class="top">
            <td style="text-align:left">
                <a class="abutton" href="<?php echo $this->url(array("controller"=>"shop","action"=>"add")); ?>">
                    <img src="<?php echo $this->baseUrl(); ?>/images/icons/add.png" /> Tambah
                </a>
            </td>
            <td colspan="5" style="text-align:right;">
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" /> = edit toko &nbsp;&nbsp;&nbsp;
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" /> = hapus toko
            </td>
        </tr>
        <tr class="head">
            <td><a class="sort" href="<?=$this->url(array("controller"=>"shop","action"=>"search","page"=>$this->page,"order"=>"name","method"=>($this->order!="name")?"asc":(($this->method=="asc")?"desc":"asc")))?>">Nama Toko</a></td>
            <td><a class="sort" href="<?=$this->url(array("controller"=>"shop","action"=>"search","page"=>$this->page,"order"=>"owner","method"=>($this->order!="owner")?"asc":(($this->method=="asc")?"desc":"asc")))?>">Nama Pemilik</a></td>
            <td><a class="sort" href="<?=$this->url(array("controller"=>"shop","action"=>"search","page"=>$this->page,"order"=>"membership_id","method"=>($this->order!="membership_id")?"asc":(($this->method=="asc")?"desc":"asc")))?>">Keanggotaan</a></td>
            <td>Kategori</td>
            <td>Keyword</td>
            <td>Aksi</td>
        </tr>
<?php
foreach ($this->shops as $shop) {
?>
    <tr style="background-color: <?= $this->cycle(array("#ccffcc", "#99ff99"))->next(); ?>;">
        <td>
            <a id="link" href="<?php echo $this->url(array("controller" => "shop", "action" => "details", "id" => $shop["shop_id"])); ?>">
            <?php echo $this->escape($shop["name"]); ?>
        </a>
    </td>
    <td><?php echo $this->escape($shop["owner"]); ?></td>
    <td>
        <?php echo $this->escape($shop["ms_name"]); ?>
        </td>
        <td>
            <ul>
            <?php foreach ($this->shops_type[$shop["shop_id"]] as $cat) {
 ?>
                <li><?php echo $this->escape($cat); ?></li>
<?php } ?>
        </ul>
    </td>
    <td>
        <ul>
<?php foreach ($this->shops_key[$shop["shop_id"]] as $key) { ?>
                <li><?php echo $this->escape($key); ?></li>
<?php } ?>
        </ul>
    </td>
    <td>
        <a href="<?php echo $this->url(array("controller" => "shop", "action" => "edit", "id" => $this->escape($shop["shop_id"]))); ?>" title="Edit">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" alt="Edit" />
        </a>&nbsp;
        <a href="javascript: del(<?php echo $this->escape($shop["shop_id"]); ?>,'<?php echo $this->escape($shop["name"]); ?>');" title="Hapus">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" alt="Hapus" />
        </a>
    </td>
</tr>
<?php
        }
?>
</table>
<?php
    // navigator
    echo $this->back;
    echo $this->current;
    echo $this->next;
?>